package com.example.demo.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.model.Books;
import com.example.demo.service.BooksService;

@RestController
@RequestMapping("book")
public class BooksController {

	@Resource
	private List<Books> books;
	
	@Resource
	private BooksService booksService;
	
	@GetMapping("save")
	public Object save() {
//		for (int i = 0; i < 10; i++) {
//			
//		}
//		Books books = new Books();
//		books.setAuthor("");
//		books.setBookName("");
//		books.setPrice(price);
		return booksService.insert(books);
	}
}
